Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

167
Vistas
How can I solve this problem "Failed to compile "


import React, { useEffect } from 'react'
import { Row, Col, List } from 'antd'
import Axios from 'axios'
import { useState } from 'react'
import SideVideo from './Sections/SideVideo'
import Subscribe from './Sections/Subscribe'



function VideoDetailPage(props) {

    const videoId = props.match.params.videoId
    const variable = { videoId: videoId }

    const [VideoState, setVideoState] = useState([])

    useEffect(() => {
        Axios.post('/api/video/getVideoDetail', variable)
            .then(response => {
                if (response.data.success) {
                    setVideoState(response.data.videoDetail)

                } else {
                    alert('fail')
                }
            })
    }, [])

    if (VideoState.writer) {
        return (
            <Row gutter={[16, 16]}>
                <Col lg={18} xs={24}>
                    <div style={{ width: '100%', padding: '3rem 4rem' }}>
                        <video style={{ width: '100%' }} src={`http://localhost:5000/${VideoState.filePath}`} controls />

                        <List.Item
                            //이 부분은 비디오 좋아요 부분
                            actions={[<Subscribe userTo={VideoState.writer._id} />]}
                        //따로 component 만들어서 페이지 보여주게 함.
                        //따로 만든 component에 사용자 id를 props로 넘겨주기 위해 userTo={Video.writer._id} 이렇게 사용
                        >
                            <List.Item.Meta
                                // avatar ={VideoState.writer.image}

                                title={VideoState.title}
                                description={VideoState.description}
                            />

                        </List.Item>

                        {/* Comment */}

                    </div>
                </Col>
                <Col lg={6} xs={24}>
                    <SideVideo />
                </Col>
            </Row>
        )
    } else {
        <div>...loading</div>
    }

    
}

export default VideoDetailPage

This is my code that has a problem when I use if(VideoState.writer):

Failed to compile
./src/components/views/VideoDetailPage/VideoDetailPage.js
  Line 63:9:  Expected an assignment or function call and instead saw an expression  no-unused-expressions

Search for the keywords to learn more about each error.

I don't how I can solve this problem.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have a <div>...loading</div> expression that isn't actually used for anything. Not returned, not assigned to anything, nothing. You probably meant to return it, i.e. return <div>...loading</div>;

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda